# -*- coding: utf-8 -*-
"""
Module Description:
Date: 2020/08/06
Author: chenmurong
"""
from pyshare.utils.time_utils import addTimes, get_one_day_end_time
from pyshare.dal.gameconfig.game_env import get_config_env_set


class PlayerRegressMixin(object):

    last_trigger_time = NotImplemented

    @property
    def end_time(self):
        """结束时间"""
        limit_param_dict = get_config_env_set("PlayerRegressLimitParam")
        # 有效持续时间
        valid_day = limit_param_dict.get("ValidDay", 15)
        end_time = get_one_day_end_time(addTimes(self.last_trigger_time, days=valid_day))
        return end_time
